<div ng-controller="CodeFormController" class="wrapper-md">
  <div class="panel panel-default">
    <div class="panel-heading">
      <h3 class="panel-title">数据表单</h3>
    </div>
    <div class="panel-body">
      <div class="row">
        <form class="form-horizontal">
          <div class="form-group">
            <label class="col-sm-2 control-label">包名:</label>
            <div class="col-sm-3">
              <input type="text" class="form-control" placeholder="" ng-model="form.parent" id="parent">
            </div>
            <label class="col-sm-2 control-label col-sm-offset-1">作者:</label>
            <div class="col-sm-3">
              <input type="text" class="form-control" placeholder="" ng-model="form.author" id="author">
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">数据源:</label>
            <div class="col-sm-9">
              <select class="form-control" ng-model="form.datasourceId" id="datasourceId"
                      ng-options="item.id as item.name for item in datasourceArr" ng-change="selectDatasource()">
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">数据表:</label>
            <div class="col-sm-9">
              <select ui-jq="chosen" multiple class="form-control" id="table" ng-model="form.tables" data-placeholder="默认所有数据表">
<!--                <option value="{{t.name}}" ng-repeat="t in tableArr">{{t.name}}</option>-->
              </select>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-2 control-label">模板:</label>
            <div class="col-sm-9">
              <select ui-jq="chosen" multiple class="form-control" ng-model="form.templates" id="template" data-placeholder="请选择模板" ng-if="id == 0">
              </select>
              <select ui-jq="chosen" multiple class="form-control" ng-model="form.templates" id="template2" data-placeholder="默认所有模板" ng-if="id != 0">
              </select>
            </div>
          </div>
        </form>
      </div>
      <div class="row col-sm-offset-5">
        <button type="button" class="btn btn-primary btn-rounded" ng-click="save()" style="width: 100px">提交</button>
      </div>
    </div>
  </div>
</div>
